//
//  ResetPasswordViewController.m
//  Restaurant
//
//  Created by Tibby on 11/5/15.
//  Copyright © 2015 Tibby. All rights reserved.
//

#import "ResetPasswordViewController.h"

@interface ResetPasswordViewController ()

@property (nonatomic, strong) UILabel* userEmailLabel;
@property (nonatomic, strong) UITextField* userEmailTextField;
@property (nonatomic, strong) UIButton* resetPasswordButton;
@end

@implementation ResetPasswordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"ResetPassword";
    self.view.backgroundColor = [UIColor whiteColor];
    [self initViews];
    [self setLayout];
    [self setListener];
}
- (void)initViews{
    self.userEmailLabel = [UILabel new];
    self.userEmailLabel.text = @"Email:";

    
    self.userEmailTextField = [UITextField new];
    self.userEmailTextField.placeholder = @"Please enter your email";
    
    self.resetPasswordButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.resetPasswordButton setTitle:@"Reset Password" forState:UIControlStateNormal];
    
    [self.view addSubview:self.userEmailLabel];
    [self.view addSubview:self.userEmailTextField];
    [self.view addSubview:self.resetPasswordButton];
    
    for (UIView* view in self.view.subviews) {
        view.translatesAutoresizingMaskIntoConstraints = NO;
    }
    
}

- (void)setLayout{
    NSDictionary* views = @{@"userEmailLabel":self.userEmailLabel,@"userEmailTextField":self.userEmailTextField,@"resetPasswordButton":self.resetPasswordButton};
    [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-10-[userEmailLabel(==100)]-10-[userEmailTextField]-10-|" options:0 metrics:nil views:views]];
    [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-10-[resetPasswordButton]-10-|" options:0 metrics:nil views:views]];
    [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-80-[userEmailLabel(==50)]-10-[resetPasswordButton(==50)]" options:0 metrics:nil views:views]];
//    [self.view addSubview:<#(nonnull UIView *)#>]
}

- (void)setListener{
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
